<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/11/20 0020
 * Time: 上午 11:25
 */
namespace app\common\validate;

class PersonnelAddValidate extends BaseValidate{
    protected $rule = [
        'p_name' => 'require|isNotEmpty',
        'departmentId' => 'require|isNotEmpty',
        'username' => 'require|isNotEmpty',
        'is_partymember' => 'checkis_partymember'
    ];

    protected $message = [
        'p_name' => '姓名不能为空',
        'prApdepartmentIdpid' => '部门不能为空',
        'username' => '登录账号不能为空',
        'is_partymember' => '党员参数类型错误'

    ];
    protected function checkis_partymember($value){
        if($value == 0 || $value == 1){
            return true;
        }else{
            return false;
        }
    }

}